<p></br>
<h1>New Account</h1>
<%= form_for(@user, :url => register_path, :html => {:class => 'well fl'}) do |f| %>
  <div>
    <% if @user.errors.any? %>
      <div class="alert alert-block alert-error fade in">
        <h4 class="alert-heading"><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h4>
        <ul>
          <% @user.profile.errors.full_messages.each do |msg| %>
            <li><%= msg %></li>
          <% end %>
          <% @user.errors.full_messages.each do |msg| %>
            <li><%= msg %></li>
          <% end %>
        </ul>
      </div>
    <% end %>

    <%= f.fields_for :profile do |builder| %>
      <div>
        <%= builder.label :name %>
        <%= builder.text_field :name %>
      </div>
    <% end %>

    <div>
      <%= f.label :username %>
      <%= f.text_field :username %>
    </div>

    <div>
      <%= f.label :email %>
      <%= f.text_field :email %>
    </div>

    <div>
      <%= f.label :password %>
      <%= f.password_field :password %>
    </div>

    <div>
      <%= f.label :password_confirmation %>
      <%= f.password_field :password_confirmation %>
    </div>
  <div>

  <div class="actions">
    <br><%= f.submit 'Send', :class => 'btn btn-primary' %> | <%= link_to 'Back', home_path, :class => 'btn' %></br>
  </div>
<% end %>
</p>